package com.jlnk.androidfmc.entity;
public class CartItem {
    private String name;
    private double price;
    private int quantity;
    private boolean selected;
    private String imagePath; // 添加图片路径属性

    // 修改构造函数以接收 Product 对象并复制 imagePath
    public CartItem(Product product) {
        this.name = product.getName();
        this.price = product.getPrice();
        this.quantity = 1; // 默认数量为 1
        this.selected = true; // 默认选中状态
        this.imagePath = product.getImagePath(); // 复制图片路径
    }

    // imagePath 的 getter 和 setter
    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }
}